<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Openlottery extends CI_Controller {
	function __construct(){
		parent::__construct();
		$this->load->library('Huashang/user');
		$this->user->checkLogin();
	}
	//载入会员列表
	public function index(){
	    $data['auth']=explode(',', $this->input->get('auth'));
		$this->load->view('openlottery/list',$data);
	}
	//获取会员列表
	public function getlist(){
		$arr=array('total'=>4,'rows'=>array(
			array('id'=>1,'xz'=>'福彩3D','kithe'=>'8789789','upline'=>'2017-02-13 21:22:47',
			'order_sn'=>'3','username'=>'6','type'=>'3','content'=>'24 / 总和大 / 总和双',
			'money'=>'龙','rebate'=>'顺子','lucky_price'=>'已开奖','result'=>'赢','pc'=>'455'),
			array('id'=>1,'xz'=>'福彩3D','kithe'=>'201709887766','upline'=>'2017-02-13 21:22:47',
			'order_sn'=>'4','username'=>'8','type'=>'6','content'=>'24 / 总和大 / 总和双',
			'money'=>'龙','rebate'=>'顺子','lucky_price'=>'已开奖','result'=>'赢','pc'=>'344'),
			array('id'=>1,'xz'=>'福彩3D','kithe'=>'8789789','upline'=>'2017-02-13 21:22:47',
			'order_sn'=>'4','username'=>'7','type'=>'7','content'=>'24 / 总和大 / 总和双',
			'money'=>'龙','rebate'=>'顺子','lucky_price'=>'已开奖','result'=>'赢','pc'=>'122'),
			array('id'=>1,'xz'=>'福彩3D','kithe'=>'8789789','upline'=>'2017-02-13 21:22:47',
			'order_sn'=>'5','username'=>'6','type'=>'4','content'=>'24 / 总和大 / 总和双',
			'money'=>'龙','rebate'=>'顺子','lucky_price'=>'已开奖','result'=>'赢','pc'=>'322'),
		));
	    echo json_encode($arr);
	}
	//保存会员列表
	public function save(){
		$id 		   			= $this -> input -> post('id');
		$row['gg_sort_order'] 	= $this -> input -> post('gg_sort_order');
		if($this -> user -> save($id,$row) && $this -> admin_sh -> add($sh)){
			echo '{"status":"OK","msg":"执行成功"}';
		}else{
			echo '{"status":"ERROR","msg":"执行失败"}';
		}
	}
	//修改会员
	public function edituser(){
		$data['rs']=array_pop($this->user->update());
		$this->load->view('member/edituser',$data);
	}
	//删除会员
	public function deluser(){
		$this->user->remove();
	}
}